<%@ page import="java.util.List" %>
<%@ page import="connection.Book" %>

<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2021/11/29
  Time: 20:33
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>图书信息</title>
</head>
<body>
<h3>图书信息</h3>
<ul>
    <%
        Object object = request.getAttribute("BookList");
        List<Book> bookList = null;
        if(object instanceof List){
            bookList = (List<Book>) object;
        }
        if(bookList!=null){
            for(Book book : bookList){
                String bookmesg = book.getId() + " " + book.getName()+ " "+book.getPrice();
    %>
    <li><%=bookmesg %></li>
    <%
            }
        }
    %>
</ul>
</body>
</html>

